import http from '../utils/request'

export function getFileList() {
    return http.request({
        url: '/performance-web/api/v3/index/convenient',
        method: 'post',
        data: {
            "platform": "APP_ANDROID",
            "areaCode": "",
            "area": "",
            "longitude": "",
            "city": "",
            "latitude": "",
            "province": "",
            "bizChannel": "WK",
            "cityCode": ""
        }
    })
}

export function gethotel() {
    return http.request({
        url: '/performance-web/api/v3/index/convenient',
        method: 'post',
        data: {
            "platform": "APP_ANDROID",
            "areaCode": "",
            "area": "",
            "longitude": "",
            "city": "",
            "latitude": "",
            "province": "",
            "bizChannel": "DJ",
            "cityCode": ""
        }
    })
}

export function getRecommend() {
    return http.request({
        url: '/performance-web/api/v3/index/recommend',
        method: 'post',
        data: {
            "platform": "APP_ANDROID",
            "bizChannel": "WK"
        }
    })
}

export function getNotService() {
    return http.request({
        url: '/surf-internet/api/service/center/info',
        method: 'get',
    })
}

export function getMyExchange() {
    return http.request({
        url: '/mall-portal/product/getProductListByCurrency',
        method: 'post',
        data: {
            "latitude": "",
            "commonCode": "",
            "clientType": "APP_ANDROID",
            "longitude": "",
            "categoryId": 62
        }
    })
}
// 特色推荐
export function getFeatureRecommendation() {
    return http.request({
        url: '/asset-web/shop/theme/config?searchType=DJJD',
        method: 'get'
    })
}
// 特色推荐-特惠推荐
export function getPreferentialRecommendation() {
    return http.request({
        url: '/asset-web/shop/theme/recommendList',
        method: 'post',
        data: {
            "latitude": "",
            "searchType": "DJJD",
            "type": "SPECIAL",
            "page": 1,
            "longitude": "",
            "pageSize": 10
        }
    })
}
// 特色推荐-品质电竞房
export function getQualityRoom() {
    return http.request({
        url: '/asset-web/shop/theme/recommendList',
        method: 'post',
        data: {
            "latitude": "",
            "searchType": "DJJD",
            "type": "QUALITY",
            "page": 1,
            "longitude": "",
            "pageSize": 10
        }
    })
}
// 特色推荐-全部
export function getAllRoom() {
    return http.request({
        url: '/asset-web/shop/theme/recommendList',
        method: 'post',
        data: {
            "latitude": "",
            "searchType": "DJJD",
            "type": "ALL",
            "page": 1,
            "longitude": "",
            "pageSize": 10
        }
    })
}

// 登陆 获取验证码
export function getLoginCode(phone: number) {
    return http.request({
        url: '/account-system/api/v3/verification/code',
        method: 'post',
        data: {
            "type": "LOGIN",
            "mobile": phone
        }
    })
}
// 成功登陆
export function getLoginSucceed(phone: number, code: number) {

    return http.request({
        url: '/account-system/api/v3/login/mobile/sms',
        method: 'post',
        data: {
            "verificationCode": code,
            "mobile": phone
        }
    })
}
//消息页面-图标
export function getMessageIcon() {
    return http.request({
        url: '/message-web/api/message/v3/providers',
        method: 'post',
        data: { "userId": "messageId" }
    })
}
//search-关键字
export function getSearchKey(key: string) {
    return http.request({
        url: '/asset-web/api/shop/v3/shopList',
        method: 'post',
        data: {
            "longitude": "",
            "keyword": key,
            "pageSize": 20,
            "latitude": "",
            "searchType": "ALL",
            "page": 1
        }
    })
}

//search-具体搜索
export function getSearchItem(keyValue: string, searchType: string) {
    return http.request({
        url: '/asset-web/api/shop/v3/shopList',
        method: 'post',
        data: {
            "longitude": "",
            "keyword": keyValue,
            "pageSize": 20,
            "latitude": "",
            "searchType": searchType,
            "page": 1
        }
    })
}

//酒店详情
export function getHotelDetails(commonCode: string) {
    return http.request({
        url: '/asset-web/api/dj/hotelInfo',
        method: 'post',
        data: {
            "latitude": "",
            "longitude": "",
            "commonCode": commonCode
        }
    })
}

//酒店详情-房间列表
export function getHotelRoom(commonCode: string) {
    // console.log('commonCode',commonCode,'nowTime',nowTime,'toTime',toTime);

    return http.request({
        url: '/asset-web/api/dj/dayRoomList',
        method: 'post',
        data: {
            "checkOutTime": "2022-12-09",
            "checkInTime": "2022-12-08",
            "commonCode": commonCode
        }
    })
}

//地区支持列表
export function getAreaSupport() {
    return http.request({
        url: '/asset-web/api/shop/v3/cityList',
        method: 'get'
    })
}

//选择地区时间后筛选的酒店列表
export function getSearchHotel(overTime: string,area: any,startTime:string,hotelType:string) {
    return http.request({
        url: '/asset-web/api/shop/v3/shopList',
        method: 'post',
        data: {
            "departureDate": startTime,   // "2022-12-25"
            "longitude": "",
            "keyword": "",
            "pageSize": 20,
            "city": area, // "广州市"
            "latitude": "",
            "checkInDate": overTime,  // "2022-12-24"
            "searchType": hotelType, // "DJJD"
            "page": 1
        }

    })
}

//商品详情列表
export function getproductDetails(id:any) {
    return http.request({
        url: '/mall-portal/product/detail',
        method: 'post',
        data: {"productId": id}

    })
}